package cn.accp.kzy.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class BBSTopic {
	private int tid;
	private int tsid;
	private BBSUser user;
	private int treplyCount;
	private String ttopic;
	private String tcontents;
	private String ttime;
	private int tclickCount=0;
	private String tlastClickT;
	private List<BBSReply> replys = new ArrayList<BBSReply>();
	@Id
	@GeneratedValue
	public int getTid() {
		return tid;
	}
	public void setTid(int tid) {
		this.tid = tid;
	}
	@ManyToOne()
	@JoinColumn(name="tuid")
	public BBSUser getUser() {
		return user;
	}
	public void setUser(BBSUser user) {
		this.user = user;
	}
	public int getTreplyCount() {
		return treplyCount;
	}
	public void setTreplyCount(int treplyCount) {
		this.treplyCount = treplyCount;
	}
	public String getTtopic() {
		return ttopic;
	}
	public void setTtopic(String ttopic) {
		this.ttopic = ttopic;
	}
	public String getTcontents() {
		return tcontents;
	}
	public void setTcontents(String tcontents) {
		this.tcontents = tcontents;
	}
	public String getTtime() {
		return ttime;
	}
	public void setTtime(String ttime) {
		this.ttime = ttime;
	}
	public int getTclickCount() {
		return tclickCount;
	}
	public void setTclickCount(int tclickCount) {
		this.tclickCount = tclickCount;
	}
	public String getTlastClickT() {
		return tlastClickT;
	}
	public void setTlastClickT(String tlastClickT) {
		this.tlastClickT = tlastClickT;
	}
	public int getTsid() {
		return tsid;
	}
	public void setTsid(int tsid) {
		this.tsid = tsid;
	}
	@OneToMany(mappedBy="topic")
	public List<BBSReply> getReplys() {
		return replys;
	}
	public void setReplys(List<BBSReply> replys) {
		this.replys = replys;
	}
	
	
	
}
